package org.raymond.iworks.study.basic.designpattern.flyweight;

import java.util.HashMap;
import java.util.Map;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
public class WebSiteFactory {
    private Map<String, ConcreteWebSite> pool = new HashMap<>();
    public WebSite getWebSite(String type){
        if(!pool.containsKey(type)){
            pool.put(type, new ConcreteWebSite(type));
        }
        return pool.get(type);
    }

    public int getWebSiteCount(){
        return pool.size();
    }
}
